Skip to content

Remove scala.internal.quoted.LiftedExpr #6793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2019

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Jul 3, 2019

  • Use reflection to implement Liftable for primitive types
  • Add missing Liftable[Byte]
  • Add Expr.nullExpr and Expr.unitExpr to lift those values without pickling

@nicolasstucki nicolasstucki force-pushed the remove-LiftedExpr branch 3 times, most recently from 8925d6f to 0609c54 Compare July 3, 2019 13:31
@nicolasstucki nicolasstucki self-assigned this Jul 3, 2019
@nicolasstucki nicolasstucki requested a review from liufengyun July 3, 2019 13:54
@nicolasstucki nicolasstucki force-pushed the remove-LiftedExpr branch 2 times, most recently from 4b86e2c to 17675b7 Compare July 3, 2019 14:06
Use reflection to implement `Liftable` for primitive types.
@nicolasstucki nicolasstucki marked this pull request as ready for review July 3, 2019 15:07
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, LGTM

@@ -1454,6 +1480,9 @@ class KernelImpl(val rootContext: core.Contexts.Context, val rootPosition: util.
def matchConstant_ClassTag(x: Constant): Option[Type] =
if (x.tag == Constants.ClazzTag) Some(x.typeValue) else None

def Constant_apply(x: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String | Type): Constant =
Constants.Constant(x)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the encoding for a classOf[T]

case _: String => liftedValue(value, "Liftable_String_delegate".toTermName, qctx)
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need special compiler support for lifting primitives? Or it's for backward-compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need it anymore.

@@ -64,6 +64,8 @@ trait TypeOrBoundsOps extends Core {

object Type {

def apply(clazz: Class[_])(implicit ctx: Context): Type = kernel.Type_apply(clazz)

object IsConstantType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the two neg-with-compiler tests are disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those tests where testing scope extrusion detection through an euristic which happens to no work anymore. I will work on more reliable mechanism for scope extrusion detection later.

@liufengyun liufengyun merged commit 96618c1 into scala:master Jul 4, 2019
@liufengyun liufengyun deleted the remove-LiftedExpr branch July 4, 2019 11:37
@nicolasstucki nicolasstucki mentioned this pull request Jul 4, 2019
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants